package com.lz.ccjdemo.act;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.lz.ccjdemo.R;
import com.lz.ccjdemo.base.BaseActivity;
import com.lz.ccjdemo.http.model.BaseModel;
import com.lz.ccjdemo.utils.TtsUtils;

public class TtsActivity extends BaseActivity<BaseModel> {
    EditText etMsg;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tts);
        etMsg=findViewById(R.id.et_msg);
    }

    public void clickPlay(View view){
        String msg=etMsg.getText().toString();
        if (TextUtils.isEmpty(msg)){
            Toast.makeText(this, "请输入要播放的文案", Toast.LENGTH_SHORT).show();
            return;
        }
        TtsUtils.getInstance().playStr(msg);
    }
}
